<?php

namespace common\models;

use Yii;
use common\components\behaviors\ImageBehavior;
/**
 * This is the model class for table "{{%project}}".
 *
 * @property integer $id
 * @property integer $c_id
 * @property integer $img_id
 * @property string $content
 * @property string $title
 * @property double $price
 * @property string $unit
 * @property integer $flag
 * @property integer $creat_time
 */
class DhProject extends \common\components\ActiveRecord2015
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return '{{%project}}';
    }
    public function behaviors() {
        return [
            'image' => [
                'class' => ImageBehavior::className()
            ]
        ];
    }
    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['c_id', 'img_id','flag', 'creat_time'], 'integer'],
            [['content'], 'string'],
            [['price'], 'number'],
            [['unit','title'], 'string', 'max' => 255]
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'id' => 'ID',
            'c_id' => 'C ID',
            'title'=>'标题',
            'img_id'=>'封面',
            'content' => '内容',
            'price' => '单价',
            'unit' => '单位',
            'flag' => 'Flag',
            'creat_time' => '创建时间',
        ];
    }


}
